<template>
<div class="bls">
	<div class="bl1">
		<el-tabs type="card" v-model="conf.nav">
			<el-tab-pane name="1" label="转库存规则列表"></el-tab-pane>
		</el-tabs>
	</div>
	<div class="bl2">
		<div class="select">
			<div class="lis">
				<div class="ite">
					<el-input size="mini" v-model="select.keyword" placeholder="请输入规则名称" ></el-input>
				</div>
				<div class="empty"></div>
				<div class="ite">
					<el-button size="mini" type="primary" @click="$refs.xi_tab.up()">搜索</el-button>
					<el-button size="mini" type="primary" plain @click="reset_select();$refs.xi_tab.up()">重置</el-button>
					<el-button size="mini" type="primary" @click="$refs.edit.init()">添加转库存规则</el-button>
				</div>
			</div>
		</div>
	</div>
	<div class="bl3">
		<xi-tab ref="xi_tab" :data="get_list" height="auto">
			<el-table-column label="序号" type="index"></el-table-column>
			<el-table-column label="禅道ID" min-width="80px">
				<template slot-scope="{row}">
					<div v-if="row.bind_type == 'appeal_story' || row.bind_type == 'appeal_story_tab' || row.bind_type == 'appeal_bug'">{{ row.bind.map(v=>v.bind_id).join(',') }}</div>
				</template>
			</el-table-column>
			<el-table-column label="诉求备注" prop="remark" min-width="80px"></el-table-column>
			<el-table-column label="操作" width="220" fixed="right">
				<template slot-scope="{row}">
					<el-button class="mbut" size="mini" type="primary" plain @click="$refs.show.init(row)">详情</el-button>
				</template>
			</el-table-column>
		</xi-tab>
	</div>
	<x-edit ref="edit"></x-edit>
</div>
</template>
<script>
import edit from "./edit.vue";

export default {
	components:{
		'x-edit':edit,
	},
	data(){
		return {
			conf:{
				nav:'1'
			},
			select:{
				keyword:'',
			},
			reset_select:(()=>{
				var d = {};
				setTimeout(()=>{Object.assign(d,this.select);})
				return ()=>{Object.assign(this.select,d)};
			})(),
		}
	},
	methods:{
		async get_list(query){
			var res = await this.$post('appeal/index',{...query,select:this.select});

			return res
		},
	},
	created(){
		
	},
}
</script>

<style lang="less" scoped>
.bls{
	background: #fff;
	padding:20px;
	height: 100%;
	display: flex;
	flex-flow: column;
	box-sizing: border-box;
	.bl2{
		.select{
			.lis{
				display: flex;
				.ite{

				}
				.empty{flex:1;}
			}
		}
	}
	.bl3{
		flex:1;height:0;
		margin-top:20px;
		display: flex;
		flex-flow: column;
	}
}
</style>